home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 121 / Computer Shopper 121 / Computer Shopper 121.iso / Internet / Demon / TURNPIKE.1 / CLASSES.ZIP / sun / AWT / WIN32 / MDialogPeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-04-14  |  2.7 KB  |  124 lines

  1. package sun.awt.win32;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Dialog;
  6. import java.awt.Event;
  7. import java.awt.Font;
  8. import java.awt.Insets;
  9. import java.awt.peer.DialogPeer;
  10. import java.util.Vector;
  11.  
  12. class MDialogPeer extends MPanelPeer implements DialogPeer {
  13.    Insets insets = new Insets(0, 0, 0, 0);
  14.    static Vector allDialogs = new Vector();
  15.  
  16.    native void create(MComponentPeer var1);
  17.  
  18.    native void pSetTitle(String var1);
  19.  
  20.    native void pShow();
  21.  
  22.    native void pHide();
  23.  
  24.    native void pReshape(int var1, int var2, int var3, int var4);
  25.  
  26.    native void pDispose();
  27.  
  28.    native void setInsets(Insets var1);
  29.  
  30.    public native void setResizable(boolean var1);
  31.  
  32.    MDialogPeer(Dialog var1) {
  33.       super(var1);
  34.       this.setInsets(this.insets);
  35.       allDialogs.addElement(this);
  36.       if (var1.getTitle() != null) {
  37.          this.pSetTitle(var1.getTitle());
  38.       }
  39.  
  40.       Font var2 = ((Component)var1).getFont();
  41.       if (var2 == null) {
  42.          var2 = new Font("Dialog", 0, 10);
  43.          ((Component)var1).setFont(var2);
  44.          ((MComponentPeer)this).setFont(var2);
  45.       }
  46.  
  47.       Color var3 = ((Component)var1).getBackground();
  48.       if (var3 == null) {
  49.          ((Component)var1).setBackground(Color.lightGray);
  50.          ((MComponentPeer)this).setBackground(Color.lightGray);
  51.       }
  52.  
  53.       var3 = ((Component)var1).getForeground();
  54.       if (var3 == null) {
  55.          ((Component)var1).setForeground(Color.black);
  56.          ((MComponentPeer)this).setForeground(Color.black);
  57.       }
  58.  
  59.       this.setResizable(var1.isResizable());
  60.    }
  61.  
  62.    public void setTitle(String var1) {
  63.       this.pSetTitle(var1);
  64.    }
  65.  
  66.    public void dispose() {
  67.       allDialogs.removeElement(this);
  68.       super.dispose();
  69.    }
  70.  
  71.    public synchronized void handleMoved(int var1, int var2) {
  72.       super.target.postEvent(new Event(super.target, 0L, 205, var1, var2, 0, 0));
  73.    }
  74.  
  75.    public void handleQuit() {
  76.       super.target.postEvent(new Event(super.target, 201, (Object)null));
  77.    }
  78.  
  79.    public void handleIconify() {
  80.       super.target.postEvent(new Event(super.target, 203, (Object)null));
  81.    }
  82.  
  83.    public void handleDeiconify() {
  84.       super.target.postEvent(new Event(super.target, 204, (Object)null));
  85.    }
  86.  
  87.    public void show() {
  88.       if (((Dialog)super.target).isModal()) {
  89.          ModalThread var1 = new ModalThread(this);
  90.          synchronized(var1){}
  91.  
  92.          try {
  93.             try {
  94.                ((Thread)var1).start();
  95.                var1.wait();
  96.             } catch (InterruptedException var5) {
  97.             }
  98.          } catch (Throwable var6) {
  99.             throw var6;
  100.          }
  101.  
  102.       } else {
  103.          this.pShow();
  104.       }
  105.    }
  106.  
  107.    public void toFront() {
  108.       this.pShow();
  109.    }
  110.  
  111.    public void toBack() {
  112.    }
  113.  
  114.    public Insets insets() {
  115.       return this.insets;
  116.    }
  117.  
  118.    public synchronized void handleResize(int var1, int var2) {
  119.       super.target.invalidate();
  120.       super.target.validate();
  121.       super.target.repaint();
  122.    }
  123. }
  124.